<template>
  <div>
    <h1>列表-2</h1>
    <ul>
      <li v-for="item in lists" :key="item.productId">
        <router-link :to="`/detail-2/${item.productId}`">{{
          item.productName
        }}</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      lists: [],
    };
  },
  mounted() {
    fetch("http://chst.vip:1234/api/getmoneyctrl")
      .then((body) => body.json())
      .then((res) => {
        // console.log(res);
        this.lists = res.result;
        // console.log(res.result);

        console.log(this.$route);
      });
  },
};
</script>
